<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="keywords" content="讯都" />
	<meta name="description" content="讯都" />
	<title>讯都新闻</title>
	<link rel="stylesheet" href="../css/css/base.css" type="text/css"/>
	<link rel="stylesheet" href="../css/css/style.css" type="text/css"/>
</head>
<body>
	<?php
		require('tance.php');
	?>
	<div class="menu-index">
		<div class="content">
			<div class="menu-list ovfl_hid">
			<a href="#" class="active">首页</a>
			<?php
				require('conn.php');
				$desc=$db->query("select * from type_admin where parentid=0");
				while($row=$desc->fetch_assoc()){
					// var_dump($row);
			?>
				<a href="module.php?id=<?php echo $row['id'];?>&&pid=<?php echo $row['id'];?>&&sid=<?php echo $row['id'];?>"><?php echo $row['type_name'];?></a>
			<?php }?>
			</div>
		</div>
	</div>
	<div class="main">
		<div class="content ovfl_hid">
			<img src="../css/img/banner_title2.png" class="wid_dis banner-little"/>
		<?php
			$de=$db->query("select * from type_admin where parentid=0");
			while($title=$de->fetch_assoc()){
				// var_dump($title);
		?>
			<div class="submain-item">
				<h3 class="title left"><?php echo $title['type_name'];?><span class="color_red"><?php echo $title['detail'];?></span></h3>
				<div class="submenu-list right taright">
				<?php 
					$er=$db->query("select * from type_admin where parentid=".$title['id']."");
					while($ji=$er->fetch_assoc()){
				?>
					<!-- <a href="#"><?php echo $ji['type_name'];?></a> -->
					<a href="module.php?yid=<?php echo $ji['id'];?>&&pid=<?php echo $ji['parentid'];?>&&id=<?php echo $ji['id'];?>&&sid=<?php echo $ji['parentid'];?>"><?php echo $ji['type_name'];?></a> 
					|
				<?php }?>
				</div>
				<div class="submain-left clear left">
					<ul class="submain-news-list left">
					<?php 
						$ellipsis = $db->query("select * from type_admin where parentid=".$title['id']."");
						
						while($elli=$ellipsis->fetch_assoc()){
						$main = $db->query("select * from ".$new." where superior_id=".$elli['parentid']." GROUP BY title");
						while($tail=$main->fetch_assoc()){
							// var_dump($tail);die;
					?>
						<li class="ellipsis"><a href="detail.php?id=<?php echo $tail['id']?>&&tid=<?php echo $title['id'];?>&&sid=<?php echo $tail['superior_id'];?>"><?php echo $tail['title'];?></a></li>
					<?php }}?>
					</ul>
					<div class="right">
						<?php
							$ellipsis = $db->query("select * from type_admin where parentid=".$title['id']."");
							while($elli=$ellipsis->fetch_assoc()){
								// var_dump($elli);die;
							$img = $db->query("select * from ".$new." where superior_id=".$elli['parentid']." and is_pic=0 order by id desc limit 3");
							// var_dump($img);die;
							while($src = $img->fetch_assoc()){
								// var_dump($src);die;
						?>
						<div class="news-right-img">
							<img src=<?php echo $src['pic'];?> class="wid_dis"/>
							<p class="news-img-info ellipsis"><a href="detail.php?id=<?php echo $src['id']?>&&tid=<?php echo $title['id'];?>&&sid=<?php echo $src['superior_id'];?>"><?php echo $src['title'];?></a></p>
						</div>
						<?php }}?>
					</div>
				</div>
				<div class="submain-right right">
					<ul class="submain-news-list">
						<h4 class="subtitle">热门资讯</h4>
						<?php
							$img = $db->query("select * from news where superior_id=".$title['id']." and is_hot=1 limit 2");
							// var_dump($title['parentid']);die;
							while($src = $img->fetch_assoc()){
								// var_dump($src);die;
						?>
						<div class="news-right-img left">
							<img src=<?php echo $src['pic'];?> class="wid_dis"/>
							<p class="news-img-info ellipsis"><a href="detail.php?id=<?php echo $src['id']?>&&tid=<?php echo $title['id']?>&&sid=<?php echo $src['superior_id']?>"><?php echo $src['title'];?></a></p>
						</div>
						<?php }?>
						<?php
							$main = $db->query("select * from ".$new." where superior_id=".$title['id']." limit 4");
							while($tail=$main->fetch_assoc()){
								// var_dump($tail);die;
								if($tail['is_hot']==1){
						?>
						<li class="clear ellipsis"><a href="detail.php?id=<?php echo $tail['id']?>&&tid=<?php echo $title['id']?>&&sid=<?php echo $tail['superior_id']?>"><?php echo $tail['title'];?></a></li>
						<!--<li class="ellipsis"><a href="#">悦纳的海外兄弟 全新现代Solaris官图</a></li>-->
						<?php }}?>
					</ul>
					<ul class="submain-news-list">
						<h4 class="subtitle">热门推荐</h4>
						<?php
							$img = $db->query("select * from news where superior_id=".$title['id']." and recommended=1 limit 2");
							// var_dump($title['parentid']);die;
							while($src = $img->fetch_assoc()){
								// var_dump($src);die;
						?>
						<div class="news-right-img left">
							<img src=<?php echo $src['pic'];?> class="wid_dis"/>
							<p class="news-img-info ellipsis"><a href="detail.php?id=<?php echo $src['id']?>&&tid=<?php echo $title['id']?>&&sid=<?php echo $src['superior_id']?>"><?php echo $src['title'];?></a></p>
						</div>
						<?php }?>
						<?php
							$main = $db->query("select * from ".$new." where superior_id=".$title['id']." limit 4");
							while($tail=$main->fetch_assoc()){
								// var_dump($tail);die;
								if($tail['recommended']==1){
						?>
						<li class="clear ellipsis"><a href="detail.php?id=<?php echo $tail['id']?>&&tid=<?php echo $title['id']?>&&sid=<?php echo $tail['superior_id']?>"><?php echo $tail['title'];?></a></li>
						<!--<li class="ellipsis"><a href="#">悦纳的海外兄弟 全新现代Solaris官图</a></li>-->
						<?php }}?>
					</ul>
				</div>
			</div>
		<?php }?>
		</div>
	</div>
	<?php
		require('bottom.php');
	?>
	<script type="text/javascript" src="../css/js/jquery-1.11.1.js" ></script>
</body>
</html>
